<template>
  <div class="appHeader">
    <label for="todolist-ipt">ToDoList</label>
    <input type="text" v-model="todolistMsg" @keyup.enter="sendMsg" id="todolist-ipt"
           placeholder="代办事项">
  </div>
</template>

<script>
export default {
  name: 'appHeader',
  data() {
    return {
      todolistMsg: '',
    };
  },
  methods: {
    sendMsg() {
      this.$emit('msgchange', this.todolistMsg);
      this.todolistMsg = '';
    },
  },
};
</script>

<style scoped>
  .appHeader {
    height: 80px;
    background: #323232;
  }

  .appHeader > label, input {
    display: inline-block;
    vertical-align: middle;
  }

  .appHeader > label {
    width: 20%;
    line-height: 80px;
    text-align: center;
    color: #fff;
  }

  .appHeader > input {
    outline: none;
    width: 70%;
    border: 1px solid #323232;
    height: 38px;
    border-radius: 3px;
    text-indent: 1em;
    font-size: 18px;
    letter-spacing: 1px;
    color: #323232;
  }
</style>
